package net.comm.oper.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.oper.bean.BaseNotAdv;
import net.comm.oper.bean.Baseoperlog;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbNotAdvService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  	seqID = result.getInt(1);			//	序号
			int  	follID = result.getInt(2);			//	跟贴序号
			String  ntype = StringUtil.getValue(result.getString(3));			//	类型
			String  title = StringUtil.getValue(result.getString(4));			//	标题
			String  introduction = StringUtil.getValue(result.getString(5));	//	简介
			String  content = StringUtil.getValue(result.getString(6));		//	发贴/跟贴内容
			int  	f_ID = result.getInt(7);			//	附件ID
			String  nsort = StringUtil.getValue(result.getString(8));			//	所属板块
			int  	nsortID = result.getInt(9);			//	板块内容ID
			String  up = StringUtil.getValue(result.getString(10));				//	是否置顶
			String  status = StringUtil.getValue(result.getString(11));			//	状态
			int  	attachcnt = result.getInt(12);		//	点击次数
			int  	replycnt = result.getInt(13);		//	回复次数
			int  	userID = result.getInt(14);			//	会员ID
			String  ip = StringUtil.getValue(result.getString(15));				//	用户IP
			String  mtime = StringUtil.getValue(result.getString(16));			//	最后修改时间			
			

			// create the Resource from these fields
			return new BaseNotAdv(  seqID,  follID,  ntype,  title,	introduction,  content,  f_ID,  nsort,
					 nsortID,  up,  status,  attachcnt,  replycnt, userID,  ip,  mtime );
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
